import page
from base.base import Base

class PagePay(Base):
    #点击  我的订单链接
    def page_pay_click_my_order_link(self):
        self.base_click(page.pay_my_order)
    #点击立即支付
    def page_pay_click_now_payment(self):
        #必须先切换窗口
        self.base_switch_to_window(page.pay_my_order_title)
        self.base_click(page.pay_now_payment)
    #点击货到付款
    def page_pay_click_pay_on_delivery(self):
        #必须先切换窗口
        self.base_switch_to_window(page.pay_payment_title)
        self.base_click(page.pay_on_delivery)
    #点击确认支付
    def page_pay_click_payment_mode(self):
        self.base_click(page.pay_confirm_payment)
    #获取支付结果
    def page_pay_get_payment_result(self):
        return self.base_get_text(page.pay_payment_result)


    #组合支付业务方法
    def page_pay(self):
        self.page_pay_click_my_order_link()
        self.page_pay_click_now_payment()
        self.page_pay_click_pay_on_delivery()
        self.page_pay_click_payment_mode()

